package com.r2coding.domain.strategy.model.entity;

import com.r2coding.domain.strategy.model.valobj.RuleLogicCheckTypeVO;
import lombok.*;

/**
 * @author caolx
 * @description 规则动作实体
 * @date 2025/8/2 11:12
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class RuleActionEntity<T extends RuleActionEntity.RaffleEntity> {
    private String code = RuleLogicCheckTypeVO.ALLOW.getCode();
    private String info = RuleLogicCheckTypeVO.ALLOW.getInfo();
    private String ruleModel;
    private T data;

    /**
     * @author caolx
     * @description 抽奖动作过程实体
     * @date 2025/8/2 11:17
     */
    @SuppressWarnings("all")
    public static class RaffleEntity {
        // 标记作用
    }

    /**
     * @author caolx
     * @description 【抽奖前】规则校验实体
     * @date 2025/8/4 9:51
     */
    @EqualsAndHashCode(callSuper = true)
    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    public static class RaffleBeforeEntity extends RaffleEntity {
        /**
         * 策略ID
         */
        private Long strategyId;
        /**
         * 用户已抽奖积分
         */
        private Integer ruleWeightValue;
        /**
         * 奖品ID
         */
        private Integer awardId;
    }

    /**
     * @author caolx
     * @description 【抽奖中】规则校验实体
     * @date 2025/8/4 9:51
     */
    public static class RaffleCenterEntity extends RaffleEntity {

    }

    /**
     * @author caolx
     * @description 【抽奖后】规则校验实体
     * @date 2025/8/4 9:51
     */
    public static class RaffleAfterEntity extends RaffleEntity {

    }
}
